#include<iostream>
using namespace std;
long s, v, h1, h2;
int main()
{
	cin >> s >> v;
	if (s % v) {
		h1 = 11 + s / v;
	}
	else {
		h1 = 10 + s / v;
	}
	int hour, second;
	hour = h1 / 60;
	second = h1 % 60;
	hour = 7 - hour;
	second = 60 - second;
	if (hour < 0) {
		hour += 24;
	}
	if (hour < 10) {
		cout << "0" << hour << ":";
	}
	else {
		cout << hour << ":";
	}
	if (second == 60) {
		cout << "00" << endl;
	}
	if (second < 10) {
		cout << "0" << second << endl;
	}
	else {
		cout << second << endl;
	}
	return 0;
}